<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>LAMP圣才-注册页</title>

</head>
<link rel="stylesheet" href="../public/home/css/register.css">
<body>
<!--顶部条-->
<?php require "./foot/header.php";?>

<!--大盒子-->
<div id="big">
    <div class="btfont">
        <h3>注册</h3>
    </div>
    <div class="biaodan">
        <div class="tishi">
            <p>请填写能正常收发邮件的邮箱</p>
        </div>
        <form action="./public/useraction.php" method="post" enctype="multipart/form-data">
            <table width="380" border="0" cellspacing="15">
                <?php
                $link = mysqli_connect("localhost","root","") or die("数据连接失败");
                mysqli_set_charset($link,"utf8");
                mysqli_select_db($link,"bbs");
                $sql = "select * from userdetail where uid={$_SESSION['id']}";
                $res = mysqli_query($link,$sql);
                if($res && mysqli_num_rows($res)>0) {
                    while ($rows = mysqli_fetch_assoc($res)) {
                        $path = "./../public/home/img/";
                        $path = rtrim($path . '/') . '/';
                        ?>
                        <tr>
                            <td class="you">昵称<span> *</span></td>
                            <td class="zuo"><input type="text" name="nickname" value="<?php echo $rows['nickName']?>"></td>

                        </tr>
                        <?php
                        $select_1='';
                        $select_0='';
                        if($rows['sex']=='m'){
                            $select_1='checked';
                        }else if($rows['sex']=='w'){
                            $select_0='checked';
                        }
                        ?>
                        <tr>
                            <td class="you">性别<span> *</span></td>
                            <td>

                                <input type="radio" name="sex" value="m" <?php echo $select_1;?>>男
                                <input type="radio" name="sex" value="w" <?php echo $select_0;?>>女

                            </td>
                        </tr>
                        <tr>
                            <td class="you">电子邮箱<span> *</span></td>
                            <td class="zuo"><input type="email" name="email" value="<?php echo $rows['email']?>"></td>
                        </tr>
                        <tr>
                            <td class="you">绑定QQ<span> *</span></td>
                            <td class="zuo"><input type="text" name="QQ" value="<?php echo $rows['qq']?>"></td>
                        </tr>
                        <tr>
                            <td class="you">头像<span> *</span></td>
                            <td class="zuo">
                                <img src="<?php echo $path.$rows['photo'] ?>">
                                <input type="file" name="file"></td>
                        </tr>
                        <tr style="text-align:center;">
                            <td class="btn" colspan="2">
                                <input type="submit" value="修改"/>
                                <input type="reset" value="重置"/>
                            </td>
                        </tr>
                        <?php
                    }
                }
                ?>
            </table>
        </form>
    </div>
    <div class="butdl">
        <h3>已经注册？</h3>
        <button><a href="login.php">去登陆</a></button>
    </div>
</div>
<div id="clear"></div>
<!--大盒子结束-->

<!--页面尾开始-->
<?php require "./foot/footer.php";?>
<!--页面尾结束-->
</body>
</html>